﻿<UserControl x:Class="SoftSource.Timecard.Views.AutoFormEditorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:dataform="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit">

    <controlsToolkit:BusyIndicator x:Name="Busy"
                                   HorizontalContentAlignment="Stretch"
                                   VerticalContentAlignment="Stretch">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <dataform:DataForm x:Name="AutoDataForm"
                               CurrentItem="{Binding Value}"
                               AutoCommit="False"
                               AutoGenerateFields="True"
                               AutoEdit="True"
                               CommandButtonsVisibility="None" />

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Button x:Name="SaveButton"
                        Grid.Column="0"
                        Content="Save"
                        Click="Save_Click"
                        Margin="4" />
                <Button x:Name="CancelButton"
                        Grid.Column="1"
                        Content="Cancel"
                        Click="Cancel_Click"
                        Margin="4" />
            </Grid>
        </Grid>
    </controlsToolkit:BusyIndicator>
</UserControl>